import { createStore } from 'vuex'
import { stations } from '@/api'
export default createStore({
  state: {
    station:[]
  },
  getters: {
  },
  mutations: {
    setStateList(state, payload) {
      state[payload.key] = payload.value
    },
  },
  actions: {
    async stationList({ commit }, payload) {
      let res = await stations({ ...payload })
      if (res.data.code === 200) {
        commit("setStateList", { key: "station", value: res.data.list })
      }
    },
  },
  modules: {
  }
})
